﻿using System;
using System.Collections.Generic;  
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Wedo.Domain.Models
{
    #region Models

    public class ChangePasswordModel
    {
        [Required(ErrorMessage = "{0} 不能为空！")]
        [System.ComponentModel.DataAnnotations.DataType(System.ComponentModel.DataAnnotations.DataType.Password)]
        [DisplayName( "当前密码")]
        public string OldPassword { get; set; }

        [Required(ErrorMessage = "{0} 不能为空！")]
        //[ValidatePasswordLength]
        [System.ComponentModel.DataAnnotations.DataType(System.ComponentModel.DataAnnotations.DataType.Password)]
        [DisplayName( "新密码")]
        public string NewPassword { get; set; }

        [System.ComponentModel.DataAnnotations.DataType(System.ComponentModel.DataAnnotations.DataType.Password)]
        [DisplayName( "确认密码")]
        [Compare("NewPassword", ErrorMessage = "必须和新密码相同")]
        public string ConfirmPassword { get; set; }
    }

    public class LogOnModel
    {
        [Required(ErrorMessage = "{0} 不能为空！")]
        [DisplayName("用户名")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "{0} 不能为空！")]
        [System.ComponentModel.DataAnnotations.DataType(System.ComponentModel.DataAnnotations.DataType.Password)]
        [DisplayName("密码")]
        public string Password { get; set; }

        [DisplayName("记住?")]
        public bool RememberMe { get; set; }
    }


    public class RegisterModel
    {
        [Required(ErrorMessage = "{0} 不能为空！")]
        [DisplayName( "用户名")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "{0} 不能为空！")]
        [System.ComponentModel.DataAnnotations.DataType(System.ComponentModel.DataAnnotations.DataType.EmailAddress)]
        [DisplayName( "邮件地址")]
        public string Email { get; set; }

        [Required(ErrorMessage = "{0} 不能为空！")]
        //ValidatePasswordLength]
        [System.ComponentModel.DataAnnotations.DataType(System.ComponentModel.DataAnnotations.DataType.Password)]
        [DisplayName( "密码")]
        public string Password { get; set; }

        [System.ComponentModel.DataAnnotations.DataType(System.ComponentModel.DataAnnotations.DataType.Password)]
        [DisplayName( "确认密码")]
        [Compare("Password", ErrorMessage = "必须和密码相同")]
        public string ConfirmPassword { get; set; }
    }
    #endregion
}
